<?php


namespace api\zhengmaotong\validate;


use think\Validate;

class UserValidate extends Validate
{
    protected $rule = [
        'image' => 'require',
        'user_name' => 'require',
        'mobile' => 'require|mobile',
        'code' => 'require'
    ];
    protected $message = [
        'image.require' => '头像不能为空',
        'user_name.require' => '昵称不能为空',
        'mobile.require' => '手机号不能为空',
        'mobile.mobile' => '手机号格式不符',
        'code.require' => '验证码不能为空',
    ];
    protected $scene = [
        'register' => ['mobile','code'],
        'login' => ['mobile','code'],
        'edit' => ['image','user_name','mobile']
    ];

}